import SceneManager from "../../../LTGame/3d/SceneManager";
import CommonSaveData from "../../../LTGame/Commom/CommonSaveData";
import GlobalUnit from "../../common/GlobalUnit";

// 3d逻辑
export default class Game3d {
    public static get instance(): Game3d {
        if (this._instance == null) {
            this._instance = new Game3d();
        }
        return this._instance;
    }

    private static _instance: Game3d;

    // 3d 进入游戏
    async enterGame() {
        // 初始化  设置相机  灯光
        let camera = GlobalUnit.camera;
        let light = GlobalUnit.light;
        await this.startLvGame(CommonSaveData.instance.levelId);
    }

    async startLvGame(lv: number) {
        let scene = SceneManager.instance.getSceneByLv(lv);
        await scene.buildScene();
        // 取出预制体
        let shili = scene.prefabs["shili"];
    }
}